<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/extras/spring-security"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
</head>
<body>
<header class="main-header" layout:fragment="header">

    <!--自定义JS-->
    <script th:src="@{~/js/biz/updatePwd.js}" th:inline="javascript" type="text/javascript"></script>
    <a href="#" class="logo">
        <span class="logo-mini"><b>A</b>LT</span>
        <span class="logo-lg"><b>Admin</b>LTE</span>
    </a>
    <nav class="navbar navbar-static-top">
        <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
            <span class="sr-only">Toggle navigation</span>
        </a>
        <div class="navbar-custom-menu" sec:authorize="isAuthenticated()">
            <ul class="nav navbar-nav" >
                <li class="dropdown user user-menu" >
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                        <img th:src="@{${session.SPRING_SECURITY_CONTEXT.authentication.principal.img}}" onerror="this.src='/img/avatar5.png'"  class="user-image" alt="User Image">
                        <span class="hidden-xs" sec:authentication="name"> </span>
                    </a>
                    <ul class="dropdown-menu" >
                        <li class="user-header">
                            <img th:src="@{${session.SPRING_SECURITY_CONTEXT.authentication.principal.img}}" onerror="this.src='/img/avatar5.png'" class="img-circle" alt="User Image">
                            <p sec:authentication="name">
                            </p>
                        <li class="user-footer">
                            <div class="pull-left">
                                <a class="btn btn-default" data-toggle="modal" data-target="#updatePwdModal" onclick="updatePwd.init()">修改密码</a>
                            </div>
                            <div class="pull-right">
                                <a th:href="@{/logout}" class="btn btn-default">退出</a>
                            </div>
                        </li>
                    </ul>
                </li>
                <li>
                    <a href="#" data-toggle="control-sidebar" title="主题设置"><i class="fa fa-cogs"></i></a>
                </li>
            </ul>
        </div>
    </nav>
</header>
<aside class="control-sidebar control-sidebar-light">

</aside>

<!--密码修改Modal-->
<div class="modal fade" id="updatePwdModal">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close" onclick="updatePwd.formReset();">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">密码修改</h4>
            </div>
            <form class="form-horizontal" id="updatePwdForm">
                <div class="modal-body">
                    <div class="box-body">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">当前用户:</label>
                            <div class="col-sm-10">
                                <span class="form-control" sec:authentication="name"> </span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="oldPassword" class="col-sm-2 control-label">旧密码:</label>
                            <div class="col-sm-10">
                                <input type="password" class="form-control" id="oldPassword" name="oldPassword">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="newPassword" class="col-sm-2 control-label">新密码:</label>
                            <div class="col-sm-10">
                                <input type="password" class="form-control" id="newPassword" name="newPassword">
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="comfirmPassword" class="col-sm-2 control-label">确认密码:</label>
                            <div class="col-sm-10">
                                <input type="password" class="form-control" id="comfirmPassword" name="comfirmPassword">
                            </div>
                        </div>
                    </div>

                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default pull-left" data-dismiss="modal" onclick="updatePwd.formReset();">关闭
                    </button>
                    <button type="button" class="btn btn-primary" onclick="updatePwd.updatePwd()">修改</button>
                </div>
            </form>
        </div>
    </div>
</div>
</body>
</html>